package com.ruoyi.littleRedBook.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 优惠券表
 * </p>
 *
 * @author
 * @since
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Coupon implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 优惠券id
     */
    @TableId(value = "coupon_id", type = IdType.AUTO)
    private Long couponId;

    /**
     * 优惠券名称
     */
    @TableField("name")
    private String name;

    /**
     * 库存数量
     */
    @TableField("stock_quantity")
    private Integer stockQuantity;

    /**
     * 每人限领取的数量
     */
    @TableField("per_person_limit")
    private Integer perPersonLimit;

    /**
     * 单位（如：份）
     */
    @TableField("unit")
    private String unit;

    /**
     * 动态语id
     */
    @TableField("dynamic_text_id")
    private Long dynamicTextId;

    /**
     * 卡券图片url
     */
    @TableField("image_url")
    private String imageUrl;

    /**
     * 最晚领取时间
     */
    @TableField("latest_receive_time")
    private LocalDateTime latestReceiveTime;

    /**
     * 领取后的有效时间
     */
    @TableField("valid_duration")
    private Integer validDuration;

    /**
     * 领取方式（0，1，2）
     */
    @TableField("receive_method")
    private Integer receiveMethod;

    /**
     * 使用说明
     */
    @TableField("use_instructions")
    private String useInstructions;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 已领取了的数量
     */
    @TableField("received_quantity")
    private Integer receivedQuantity;

    /**
     * 创建人
     */
    @TableField("creator")
    private String creator;

    /**
     * 逻辑删除标志（0-正常，1-删除）
     */
    @TableField("is_deleted")
    private Integer isDeleted;



    @Override
    public String toString() {
        return "Coupon{" +
        "couponId=" + couponId +
        ", name=" + name +
        ", stockQuantity=" + stockQuantity +
        ", perPersonLimit=" + perPersonLimit +
        ", unit=" + unit +
        ", dynamicTextId=" + dynamicTextId +
        ", imageUrl=" + imageUrl +
        ", latestReceiveTime=" + latestReceiveTime +
        ", validDuration=" + validDuration +
        ", receiveMethod=" + receiveMethod +
        ", useInstructions=" + useInstructions +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", receivedQuantity=" + receivedQuantity +
        ", creator=" + creator +
        ", isDeleted=" + isDeleted +
        "}";
    }
}
